//
//  TopView.m
//  ShiShiBang
//
//  Created by loujianwei on 16/9/24.
//  Copyright © 2016年 motianjituan. All rights reserved.
//

#import "TopView.h"
#import <Masonry.h>

@implementation TopView

- (void)setUpTopChildView:(BOOL)aBool {

    UIImageView *imageView = [[UIImageView alloc] init];
    [self addSubview:imageView];

    UILabel *topLabel = [[UILabel alloc] init];
    topLabel.font = [UIFont systemFontOfSize:10.5];
    topLabel.textColor = MTColor(222, 222, 222);
    [self addSubview:topLabel];

    UILabel *bottomLabel = [[UILabel alloc] init];
    bottomLabel.font = [UIFont systemFontOfSize:16];
    [self addSubview:bottomLabel];

    if (aBool) {
        topLabel.text = @"技能";
        bottomLabel.text = @"有求必应";
        imageView.image = [UIImage imageNamed:@"Icon_jineng"];
    }else {
        topLabel.text = @"身份";
        bottomLabel.text = @"我的认证";
        imageView.image = [UIImage imageNamed:@"Icon_renzheng"];
    }
    [topLabel sizeToFit];
    [bottomLabel sizeToFit];

    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.mas_centerY);
        make.left.equalTo(self.mas_left).offset(20);
        make.width.equalTo(@(35.5));
        make.height.equalTo(@(35.5));
    }];
    [topLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(imageView.mas_right).offset(10);
        make.top.equalTo(imageView.mas_top);
        make.width.equalTo(@(topLabel.frame.size.width));
        make.height.equalTo(@(topLabel.frame.size.height));
    }];
    [bottomLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(topLabel.mas_left);
        make.bottom.equalTo(imageView.mas_bottom);
        make.width.equalTo(@(bottomLabel.frame.size.width));
        make.height.equalTo(@(bottomLabel.frame.size.height));
    }];
}










@end
